package cn.gson.springboot.model.dao.presaledao;

import cn.gson.springboot.model.pjos.Demand;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.List;

public interface DemandDao extends CrudRepository<Demand, Integer> {
    /**
     * 查询需求的具体信息
     * @param demandId
     * @return
     */
    @Query(value = "select * from  demand where demand_id=?1", nativeQuery = true)
    Demand searchDemand(Integer demandId);

//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update demand set custom_id = ?1 where custom_id = ?2")
    public void update(Integer daoId,Integer congId);
}
